home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Testing & Debugging / Audit / Src / LogManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-21  |  2.8 KB  |  109 lines  |  [TEXT/KAHL]

  1. /*                                    LogManager.h                                */
  2. /*
  3.  * LogManager.h
  4.  * Copyright © 1993 Apple Computer Inc. All rights reserved.
  5.  *
  6.  * These functions manage a logging display for error messages and other text.
  7.  * The log is implemented as a ListManager list that can hold nLogItems. This
  8.  * module is intentionally more-or-less self-contained so it can easily be
  9.  * exported to other applications.
  10.  */
  11. #ifndef THINK_C                /* MPW includes            */
  12. #include <Errors.h>
  13. #include <Script.h>
  14. #include <Types.h>
  15. #include <Resources.h>
  16. #include <QuickDraw.h>
  17. #include <Fonts.h>
  18. #include <Events.h>
  19. #include <Windows.h>
  20. #include <ToolUtils.h>
  21. #include <Memory.h>
  22. #include <Lists.h>
  23. #endif
  24. /*
  25.  * CreateLog
  26.  *        Create a new log display in the current window. To define a log, first
  27.  *        SetPort to the window, and pass viewRect in window coordinates. Returns
  28.  *        NULL on errors. if nLogLines is zero, a default value (128) will be used.
  29.  *        Note: the log will be displayed with a horizontal and vertical scrollbar.
  30.  *        Be sure to dimension the viewRect to leave room for both. If hasGrowBox
  31.  *        is FALSE, the list rectangle will be adjusted so there is an integral
  32.  *        number of cells displayed.
  33.  */
  34. ListHandle                            CreateLog(
  35.         const Rect                        *viewRect,
  36.         Boolean                            hasGrowBox,
  37.         short                            listFontNumber,
  38.         short                            listFontSize,
  39.         short                            nLogLines
  40.     );
  41. /*
  42.  * DisposeLog
  43.  *        Dispose of the log. logListHandle may be NULL.
  44.  */
  45. void                                DisposeLog(
  46.         ListHandle                        logListHandle
  47.     );
  48. /*
  49.  * DoClickInLog
  50.  *        Call on a mouse-down in the log viewRect. Returns FALSE if the mouse-down
  51.  *        wasn't in the viewRect (this isn't really an error, but lets you call
  52.  *        DoClickInLog on all mouseDown's). Note: the port should be set to the log
  53.  *        window. You cannot select text in the log.
  54.  */
  55. Boolean                                DoClickInLog(
  56.         ListHandle                        logListHandle,
  57.         const EventRecord                *eventRecord
  58.     );
  59. /*
  60.  * UpdateLog
  61.  *        Call on update events in the log window.
  62.  */
  63. void                                UpdateLog(
  64.         ListHandle                        logListHandle
  65.     );
  66. /*
  67.  * ActivateLog
  68.  *        Call on activate, suspend, and resume events.
  69.  */
  70. void                                ActivateLog(
  71.         ListHandle                        logListHandle,
  72.         Boolean                            activating
  73.     );
  74. /*
  75.  * MoveLog
  76.  *        Move the log area within the window.
  77.  */
  78. void                                MoveLog(
  79.         ListHandle                        logListHandle,
  80.         short                            leftEdge,
  81.         short                            topEdge
  82.     );
  83. /*
  84.  * SizeLog
  85.  *        Change the size of the log area.
  86.  */
  87. void                                SizeLog(
  88.         ListHandle                        logListHandle,
  89.         short                            newWidth,
  90.         short                            newHeight
  91.     );
  92. /*
  93.  * LogStatus
  94.  *        Call with an error status code and some text to display.
  95.  */
  96. void                                LogStatus(
  97.         ListHandle                        logListHandle,
  98.         OSErr                            theError,
  99.         const StringPtr                    infoText
  100.     );
  101. /*
  102.  * DisplayLogString
  103.  *        Call with some text to display.
  104.  */
  105. void                                DisplayLogString(
  106.         ListHandle                        logListHandle,
  107.         const StringPtr                    theString
  108.     );
  109.